document.addEventListener("DOMContentLoaded", () => { const lightbox = GLightbox({ closeOnOutsideClick: true }); document.querySelectorAll('.lightbox-trigger').forEach(el => { const img = el.getAttribute('data-image'); el.addEventListener('click', () => { // Scroll to top and reset zoom window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); document.body.style.transform = "scale(1)"; document.body.style.transformOrigin = "top left"; // Open appropriate content if (img) { lightbox.setElements([{ href: img, type: 'image' }]); lightbox.open(); } }); }); });